package com.ddone.mapper;

import com.ddone.bean.User;
import org.springframework.data.elasticsearch.annotations.Query;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;

import java.util.List;

/**
 * @author ddone
 * @date 2024/4/9-18:18
 */
public interface UserEsRepository extends ElasticsearchRepository<User,Long> {
    List<User>  findByAgeBetween(Integer age1,Integer age2);

    @Query("{\n" +
            "    \"match\": {\n" +
            "      \"name\": \"?0\"\n" +
            "    }\n" +
            "  }")
    List<User> queryByName(String name);
}
